﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="fsw.Web.Mould.List" %>

<%@ Import Namespace="fsw.Common" %>
<%@ Register Src="~/HeaderJs.ascx" TagPrefix="uc1" TagName="HeaderJs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>模块管理</title>
    <uc1:HeaderJs runat="server" ID="HeaderJs" />
</head>
<body>
    <div class="position">当前位置：<a href="List.aspx">模块管理</a></div>
    <div class="border">
        <form id="form1" runat="server" class="am-form2">
            <div class="am-btn-group">
                <a href="Add.aspx" class="am-btn am-btn-secondary am-radius am-text-sm am-margin-right-sm"><span class="am-icon-plus am-margin-right-sm"></span>添加模块</a>
                <input type="submit" name="SaveOrder" value="更新排序" class="am-btn am-btn-warning am-radius am-text-sm" />
            </div>
            <div class="am-form am-form-inline am-fr">
                <div class="am-form-group am-form-icon">
                    <i class="am-icon-search"></i>
                    <asp:TextBox ID="txtKeywords" runat="server" CssClass="am-form-field am-input-sm" placeholder="请输入关键字" />
                    <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="am-btn am-btn-warning am-radius am-text-sm" OnClick="lbtnSearch_Click">搜索</asp:LinkButton>
                </div>
            </div>
            <div class="am-cf"></div>
            <div class="am-panel am-panel-default am-margin-top">
                <div class="am-panel-hd">
                    <h3 class="am-panel-title">项目列表</h3>
                </div>
                <asp:Repeater ID="rptList" runat="server">
                    <HeaderTemplate>
                        <table class="am-table am-table-hover">
                            <thead>
                                <tr>
                                    <th width="10">ID</th>
                                    <th width="120">模块名称</th>
                                   
                                    <th width="45">排序</th>
                                    <th width="45">时间</th>
                                    <th width="50">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td><%#Eval("Id") %></td>
                            <td><%#Eval("MouldName") %></td>                           
                            <td>
                                <input type="hidden" name="hidId" value="<%#Eval("Id") %>" />
                                <input type="text" name="OrderbyID" value="<%#Eval("OrderNo") %>" onkeydown="return checkNumber(event);" /></td>
                            <td><%#Utils.GetTime(Eval("CreateDate").ToString()) %></td>
                            <td><a href="Edit.aspx?id=<%#Eval("Id")%>" title="编辑"><span class="am-icon-edit"></span>编辑</a></td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        <%#rptList.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"5\">暂无记录</td></tr>" : ""%></tbody></table>
                    </FooterTemplate>
                </asp:Repeater>
                <div class="border-top am-padding">
                    <div class="am-u-sm-10 pagelist">
                        <ul>
                            <div id="PageContent" runat="server" class="am-fl"></div>
                            <div class="am-fr">
                                <asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                                    OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox>条/页
                            </div>
                        </ul>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </form>
    </div>
    <script>
        $(function () {
            toastr.options = { "positionClass": "toast-bottom-center", "timeOut": "3000", "onclick": null, showMethod: "slideDown", hideMethod: "slideUp" };
            $('.am-form2').validator({
                timely: 2,
                stopOnError: true,
                focusCleanup: true,
                ignore: ':hidden',
                theme: 'yellow_right_effect',
                msgMaker: function (opt) { if (opt.type == 'error') { toastr.clear(); toastr.error(opt.msg); } },
                valid: function (form) {
                    $.AMUI.progress.inc();
                    $.ajax({
                        type: 'post',
                        cache: false,
                        dataType: 'json',
                        url: 'List.aspx?action=orderId',
                        data: $(form).serialize(),
                        error: function (e) { alert(e.responseText); },
                        success: function (d) {
                            $.AMUI.progress.set(1.0);
                            if (d.state == 'success') {
                                toastr.success(d.msg);
                                setTimeout(function () { window.location.reload(); }, 1500);
                            }
                            else {
                                toastr.error(d.msg);
                            }

                        }
                    })
                }
            });

        })
    </script>
</body>
</html>
